/*
 * Creation : 27/09/2013
 */
/**
 * 
 */
package com.japcatalog.service.impl;

import java.util.Collection;

import com.japcatalog.dao.ProviderDao;
import com.japcatalog.dao.impl.ProviderDaoImpl;
import com.japcatalog.model.Provider;
import com.japcatalog.service.ProviderService;

/**
 * The Class ProviderServiceImpl.
 * 
 * @author Fernando Ariel Perelli
 */
public class ProviderServiceImpl implements ProviderService {

	/** The provider dao. */
	private ProviderDao providerDao = new ProviderDaoImpl();

	/**
	 * Getter providerDao.
	 * 
	 * @return the providerDao
	 */
	public ProviderDao getProviderDao() {
		return providerDao;
	}

	/**
	 * Setter providerDao.
	 * 
	 * @param providerDao
	 *            the providerDao to set
	 */
	public void setProviderDao(ProviderDao providerDao) {
		this.providerDao = providerDao;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ProviderService#findById(java.lang.Long)
	 */
	@Override
	public Provider findById(Long id) {
		return this.providerDao.findById(id);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ProviderService#findALL()
	 */
	@Override
	public Collection<Provider> findALL() {
		return this.providerDao.findAll();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ProviderService#create(com.japcatalog.model.Provider)
	 */
	@Override
	public Long create(Provider provider) {
		return this.providerDao.create(provider);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ProviderService#update(com.japcatalog.model.Provider)
	 */
	@Override
	public void update(Provider provider) {
		this.providerDao.update(provider);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ProviderService#delete(com.japcatalog.model.Provider)
	 */
	@Override
	public void delete(Provider provider) {
		this.providerDao.delete(provider);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.japcatalog.service.ProviderService#delete(java.lang.Long)
	 */
	@Override
	public void delete(Long id) {
		this.providerDao.delete(id);

	}

}
